﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Data.Extensions;
using ModernChannel.Configuration;
using ModernChannel.Model.Model;
using Common.Contract.Customer.Identifier;

namespace ModernChannel.Data.DBConfig
{
    public class ShopInfConfiguration : DBConfig<ShopInf>
    {
        public ShopInfConfiguration()
            : base(SystemConfiguration.Schema, SystemConfiguration.NamingType, SystemConfiguration.TABLE_PREFIX)
        {
            HasKey(k => k.ShopCode);
            Property(c => c.ShopCode).HasMaxLength(10).IsRequired();
            Property(c => c.UseFlag).HasMaxLength(1).IsRequired();
            Property(c => c.CellNo1).HasMaxLength(20).IsRequired();
            Property(c => c.ShopName).HasMaxLength(100).IsRequired();

            //HasOptional(s => s.Region).WithMany(p => p.ShopInfos).HasForeignKey(k => k.RegId).WillCascadeOnDelete(false); 
        }
    }
}
